import { useFetchPost } from '~/composables/useHttp/useFetch'
import { useFetchRefGet } from '~/composables/useHttp/useFetchRef'

/**
 * 添加弹幕
 */
export const danmakuApi = <T>(body: T) => {
    return useFetchPost<R<T>>('danmakuApi', '/danmu/save', {
        body: body!
    })
}
/**
 * 弹幕屏蔽
 */
export const shieldDanmakuApi = <T>(danmuId: string) => {
    return useFetchPost<R<T>>('shieldDanmakuApi', `/danmu/shield/${danmuId}`)
}
/**
 * 弹幕列表
 */
export const danmakusApi = (articleId: string | number) => {
    return useFetchRefGet<DanMuVo>('danmakusApi', `/danmu/list/${articleId}`)
}